<?php

class Jf_Paginator_Adapter_Iterator implements Zend_Paginator_Adapter_Interface {

    protected $_iterator = null;

    protected $_count = null;

    public function __construct (Iterator $iterator, $count) {
        $this -> _iterator = $iterator;
        $this -> _count = $count;
    }

    public function getItems ($offset, $itemCountPerPage) {
        if ($this -> _count == 0) {
            return array();
        }
        return $this -> _iterator;
    }

    public function count () {
        return $this -> _count;
    }

}